/*根元素样式*/
:root {
    --green: #2ecc71;
    --dark-green: #27ae60;
    --light-bg: #f4fdf6;
    --text-color: #333;
}

/*基础样式*/
body {
    margin: 0;
    font-family: 'Helvetica Neue', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
}

/* 顶部导航 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--green);
    padding: 1rem 2rem;
    color: white;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links a {
    margin: 0 1rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
}
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 横幅 */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    /*设计渐变效果*/
    background: linear-gradient(to right, #2ecc71, #a3e4d7);
    color: white;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* 主体内容布局 */
.container {
    display: flex;
    padding: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

/* 文章卡片 */
.main-content {
    flex: 3;
}

.post-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    /*设置阴影效果*/
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-card h2 {
    color: var(--dark-green);
}

.post-card a {
    text-decoration: none;
    color: var(--green);
    font-weight: bold;
}

/* 侧边栏 */
.sidebar {
    flex: 1;
}

.widget {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tags span {
    display: inline-block;
    background-color: var(--green);
    color: white;
    padding: 0.3rem 0.6rem;
    margin: 0.2rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--dark-green);
    color: white;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        background-color: var(--green);
        position: absolute;
        top: 60px;
        right: 20px;
        width: 150px;
        border-radius: 5px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .nav-links a {
        padding: 0.75rem;
        border-bottom: 1px solid rgba(255,255,255,0.3);
    }
    .menu-toggle {
        display: block;
    }
    .nav-links.active {
        display: flex;
    }
}
